package com.ys.zero.biz;

import java.util.List;
import java.util.Map;

import com.ys.zero.bean.Comment;
import com.ys.zero.dao.CommentDao;

/**
 * 评论的Biz
 * @author Administrator
 *
 */
public class CommentBiz {
	
	private CommentDao dao = new CommentDao();

	public void insertCommment(String cuaid, String account, String content) throws BizException {
		if(content.isEmpty() || content.trim().isEmpty()) {
			throw new BizException("评论内容不能为空");
		}
		if(cuaid.isEmpty()||cuaid.trim().isEmpty()) {
			throw new BizException("文章评论拉取失败，请刷新重试！");
		}
		dao.insertCommment(cuaid, account, content);
	}

	public List<Map<String, Object>> queryComment(String cuaid) throws BizException {
		if(cuaid.isEmpty()||cuaid.trim().isEmpty()) {
			throw new BizException("文章评论拉取失败，请刷新重试！");
		}
		return dao.queryComment(cuaid);
	}
	
//	public void hcomment(String huaid, String bhaccount, String haccount, String hcomment) throws BizException {
//		if(hcomment.isEmpty() || hcomment.trim().isEmpty()) {
//			throw new BizException("评论内容不能为空");
//		}
//		if(huaid.isEmpty()||huaid.trim().isEmpty()) {
//			throw new BizException("文章评论拉取失败，请刷新重试！");
//		}
//		dao.hcomment(huaid,bhaccount,haccount,hcomment);
//	}	
}
